﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Dapper.Web.Admin.Login" %>
<%Server.Execute("Header.aspx");%>
<body>
	<div class="body body-950">
		<div class="container">
			<div class="column-07 start-09 typecho-login">
				<h2 class="logo-dark">
					typecho</h2>
				<form action="Handle/Login.ashx" method="post" id="loginForm" name="Login">
				<fieldset>
					<p>
						<label for="userName">
							用户名:</label>
						<input type="text" id="userName" name="userName" value="" class="text" /></p>
					<p>
						<label for="password">
							密码:</label>
						<input type="password" id="password" name="password" class="text" /></p>
					<p class="submit">
						<label for="remember">
							<input type="checkbox" name="remember" class="checkbox" value="1" id="remember" />
							记住我</label>
						<button type="submit">
							登录</button>
						<input type="hidden" name="ReturnUrl" value="<%=ReturnUrl %>" />
					</p>
				</fieldset>
				</form>
				<div class="more-link">
					<p class="back-to-site">
						<a href="http://www.dao-gu.com/" class="important">&laquo; 返回捣鼓笔记</a>
					</p>
					<p class="forgot-password">
					</p>
				</div>
			</div>
		</div>
	</div>
	<!-- JavaScript -->
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/jquery.form.js"></script>
	<script type="text/javascript">
		$(document).ready(function () {
			var options = {
				success: LoginResult,
				dataType: 'json'
			};
			$('#loginForm').ajaxForm(options);
		});
		function LoginResult(json) {
			switch (json.result) {
				case "true":
					window.location = json.ReturnUrl;
					break;
				case "null":
					alert("请填写完整！");
					break;
				case "false":
					alert("用户名密码错误，请重试！");
					break;
				default:
					alert("未知错误");
			}
		}
	</script>
</body>
</html>
